package android.medicalcloud.com.yiapp.yilian.utils.android;

import android.content.Context;
import android.content.Intent;
import android.medicalcloud.com.yiapp.yilian.model.OrderModel;
import android.medicalcloud.com.yiapp.yilian.model.PatitentModel;
import android.medicalcloud.com.yiapp.yilian.ui.FindPassActivity;
import android.medicalcloud.com.yiapp.yilian.ui.MainPageActivity;
import android.medicalcloud.com.yiapp.yilian.ui.OrderDetailActivity;
import android.medicalcloud.com.yiapp.yilian.ui.PatientDetailActivity;
import android.medicalcloud.com.yiapp.yilian.ui.ac.LoginActivity;
import android.medicalcloud.com.yiapp.yilian.ui.ac.PersonDetialActivity;
import android.medicalcloud.com.yiapp.yilian.ui.ac.WebViewActivity;
import android.net.Uri;

/**
 * Created by wanggenlin on 16-11-22.
 * enter ac dex
 */
public class IntentTool {

    public static void startMain(Context context) {
        Intent intent = new Intent(context, MainPageActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        context.startActivity(intent);
    }


    public static void login(Context context) {
        Intent intent = new Intent(context, LoginActivity.class);
        context.startActivity(intent);
    }

    public static void findPassword(Context context) {
        Intent intent = new Intent(context, FindPassActivity.class);
        context.startActivity(intent);
    }
    public static void orderDetail(Context context, OrderModel model) {
        Intent intent = new Intent(context, OrderDetailActivity.class);
        context.startActivity(intent);
    }

    public static void patient(Context context, PatitentModel model) {
        Intent intent = new Intent(context, PatientDetailActivity.class);
        context.startActivity(intent);
    }


    public static void webview(Context context,String url,String title) {
        Intent intent = new Intent(context, WebViewActivity.class);
        intent.putExtra("url",url);
        intent.putExtra("title",title);
        context.startActivity(intent);
    }
    public static void call(Context context,String phone) {
        Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"+phone));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }


    public static void person(Context context) {
        Intent intent = new Intent(context, PersonDetialActivity.class);
        context.startActivity(intent);
    }
}

